<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>转换json值</title>
    <link href="${pageContext.request.contextPath}/css/fontawesome.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div id="result"></div>
</body>
</html>
<script src="${pageContext.request.contextPath}/js/jquery.json.min.js"></script>
<script src="${pageContext.request.contextPath}/js/json2.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jsonlint.min.js"></script>

<script>
    $(function () {
        var content = '${show}';
        content = decodeURIComponent(content);
        $.CurrentDialog.find("#resultInput").val(content);
        try {
            jsonlint.parse(content);
           var result = new JSONFormat(content, 4).toString();
        } catch (e) {
            result = '<span style="color: green;font-weight: bold;">Body :' + content + '</span><br><br><span style="color: #f1592a;font-weight:bold;">' + e + '</span>';
        }
        $.CurrentDialog.find("#result").html(result);
    });
</script>